/*=+--+=#=+--     Unmanned Aerial System Management Software      --+=#=+--+=#*\
|          Copyright (C) 2011 Regents of the University of Colorado.           |
|                             All Rights Reserved.                             |

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.

            Jack Elston                       Cory Dixon                        
|           elstonj@colorado.edu              dixonc@colorado.edu              |
|                                                                              |
\*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*/

/***********************************************************************
 *
 * FILENAME:
 *  cameraDaemon.cxx
 *
 * PURPOSE:
 *  Provide video positioning system
 *
 * CREATED:
 * 05/2008 by Cory Dixon
 *
 * MODIFIED:
 * 04/2009 by Rob Witoff
 *
 *
 ***********************************************************************/

#ifndef _CAMERADAEMON_H
#define _CAMERADAEMON_H


#define VERSION     "0.0.1"
#define VERSION_INT  1

#define MAX_NUM_ROOMBA 32 //Max supported by bar codes
#define NUM_CAMS 4 //max supported by video card

#define SYSCONF_DIR "/usr/local/roomba/"
#define CONFIG_FILE "cameraDaemon.conf"

#include <math.h>

struct CamConf { //Camera Configuration File
	int confInd;
	const char *dev;
	int width;
	int height;
	int bin_thresh;
	int led_thresh;
	int dilate;
	float intrinsic[9];
	float distortion[4];
	float translation[3];
	float rotation[3];
	bool isCamera;
	bool isVideo;
	bool doesVideoRepeat;
	bool useCam;

	// setup default values
	CamConf() { 
		confInd	= -1;
		dev	    = 0;
		width	  = 640;
		height	 = 480;
		bin_thresh     = 100;
		led_thresh     = 200;
		dilate	 = 2;
		intrinsic[0]   = NAN;
		distortion[0]  = NAN;
		translation[0] = NAN;
		rotation[0]    = NAN;
		isCamera       = true;
		isVideo	= false;
	};
};

#include "threadedPipe.h"

  /*<-------Defines--------->*/
  /*<------End Defines------>*/

class VPS : public ThreadedPipe
{
private:
	void exit();

public:
	VPS(String name, int argc, char * argv[]);
	~VPS();

	bool init(ShmStruct * shmStructPtr);
	void update();
};



#endif //define
